import { createSlice } from "@reduxjs/toolkit";
import store from 'store2'
const songInfoSlice = createSlice({
    name: 'songInfoSlice',
    initialState: {
        songInfo: store.get('songInfo') ?? {},
    },
    reducers: {
     
        setSongInfo(state, action) {
            store.set('songInfo', action.payload)
            state.songInfo = store.get('songInfo')
            console.log(state.songInfo);
        }
    }
})


export const { setSongInfo } = songInfoSlice.actions;
export default songInfoSlice.reducer;